home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / cache.arc / CACHE.DOC < prev   
Encoding:
Text File  |  1980-01-01  |  4.1 KB  |  82 lines

  1. Purpose:
  2.  
  3.          CACHE establishes disk caches. The default cache is for all PC, XT,
  4.          and AT real (not virtual) drives other than the AT hard disk.
  5.  
  6. Format:  [d:][path]CACHE [[size] disk]
  7.  
  8. Remarks: Specify the parameters:    
  9.  
  10.          [d:][path] before CACHE to specify the drive and the path that
  11.          contains the CACHE command file.
  12.  
  13.          [size] size of the cache in 512 byte sectors. This number must be
  14.          between 24 and 124, or it will be adjusted. The default is 64. The
  15.          storage occupied by the cache is less than 256 bytes plus 518 bytes
  16.          per sector.
  17.  
  18.          [disk] disk to be cached, if a single disk cache is being allocated.
  19.          The default is to cache all real disks, but there may be occasions
  20.          where it is desirable to avoid cacheing a specific disk, or a cache
  21.          larger than 62K bytes is desired.
  22.  
  23.          CACHE can be called more than once to create a larger cache or set
  24.          individual disk caches for each disk. The caches are searched in
  25.          reverse order of allocation. If you are allocating more than one cache
  26.          allocate the most heavily used cache LAST. If you are allocating a
  27.          general cache, it makes sense to allocate it FIRST in most cases, so
  28.          it becoems a "cache of last resort". The overhead for skipping
  29.          individual caches is small, but the overhead for a search failure is
  30.          large.
  31.  
  32.          Only single sector reads and writes are cached. Therefore, loading 
  33.          large programs will not be affected. What will be affected are
  34.          databases with records smaller than 512 bytes, batch files, and
  35.          source files for language processors that scan the input file more
  36.          than once. The disk file directory and file allocation tables are
  37.          cached, and always resident once read from disk. Other files have
  38.          their sectors purged if they are not frequenly accessed.
  39.  
  40.          When the cache is allocated, its segment location is listed out. The
  41.          DOS DEBUG command can be used to read out data areas of interest,
  42.          while the cache is running. The data areas start at offset 114h. They
  43.          are each one word (two bytes) long:
  44.                     
  45.                 offset           data
  46.  
  47.                  114      Cache size in sectors
  48.                  116      Total Number of disk I/O's
  49.                  118      Number of cache hits
  50.                  11A      Number of free slots in cache
  51.  
  52.          Remember that these numbers are hexadecimal and stored low order byte 
  53.          first, so the default size of 64 is stored as: 
  54.                         
  55.                            40 00                            
  56.  
  57.          To access this data, first write down the sector address typed out
  58.          when CACHE initializes. Let's say it is 909. Type the following
  59.          commands:
  60.  
  61.          
  62.                            DEBUG
  63.                            d 909:114
  64.                            (analyze the displayed data)
  65.                            q
  66.  
  67.          Typically, the about half of all disk I/O's will result in cache hits. 
  68.          All data in cache is backed up on disk immediately, so only disk reads 
  69.          are assisted by cache. The cache should be sized so that you will not 
  70.          reduce the number of free slots to zero, the first time you perform 
  71.          your most frequent operation. Size your cache by booting your computer
  72.          and issuing the CACHE command for a 124 sector buffer, performing
  73.          your "typical" batch file, compile or data base access, running DEBUG,
  74.          determining how much CACHE remains free, and downsizing as required.
  75.          If you can't allocate a single large cache that does the job, then
  76.          create caches for heavily used disks.
  77.  
  78.          Place the CACHE commands first in your AUTOEXEC.BAT file because CACHE 
  79.          will make it run faster. Also notice that DIR commands will run with-
  80.          out pausing, and the disk will stop running about halfway through the
  81.          second time it is issued.
  82.